Creating a content object from a cairo surface may fail, in which case
we return an empty content with a 0x0 preferred size.
However when we treat such a content object as GIcon, we happily load
it anyway. Don't do that, so consumers like StIcon can fall back properly
to an alternative.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1761>
if (ST_IS_IMAGE_CONTENT (icon))
{
+ int width, height;
+
+ g_object_get (G_OBJECT (icon),
+ "preferred-width", &width,
+ "preferred-height", &height,
+ NULL);
+ if (width == 0 && height == 0)
+ return NULL;
+
return g_object_new (CLUTTER_TYPE_ACTOR,
"content-gravity", CLUTTER_CONTENT_GRAVITY_RESIZE_ASPECT,
"width", actor_size,